﻿using MRSite.Cache;
using MRSite.Common.Dependency;
using MRSite.Common.Kernels;
using MRSite.RedisCache.ProtoBuf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MRSite.RedisCache
{
    [ShanYuBaseOn(typeof(CacheKernel))]
    public class RedisCacheKernel : BaseKernel
    {
        public override void Init()
        {
            CtnManager.Regist<ShanYuRedisCache>(ShanYuLifeStyle.Transient);
            CtnManager.Regist<ICacheManager, ShanYuRedisCacheManager>();
            CtnManager.RegistAssembly(Assembly.GetExecutingAssembly());
        }
        public override void PreInit()
        {
            CtnManager.Regist<IRedisSerializer, ProroBufRedisSerializer>(ShanYuLifeStyle.Transient);
        }
    }
}
